Back

Contents

Create a local docker registry

  1. Create skeleton config.yml to override defaults.

     version: 0.1
     log:
       fields:
         service: registry
     storage:
       cache:
         blobdescriptor: inmemory
       filesystem:
         rootdirectory: /var/lib/registry
     http:
       addr: :5000
       headers:
         X-Content-Type-Options: [nosniff]
     auth:
       htpasswd:
          realm: basic-realm
          path: /etc/registry
     health:
       storagedriver:
         enabled: true
         interval: 10s
         threshold: 3
  2. Generate password for user.

     $ htpasswd -Bbn <user> <password>
  3. Insert password into registry container's etc/registry.

     $ docker exec -it registry /bin/sh
     $ echo <username>:<password> >> /etc/registry

Error response from daemon: http: server gave HTTP response to HTTPS client

This can occur when pulling images. To fix from your local machine you must allow insecure access to registries:

  1. Create/modify /etc/docker/daemon.json adding:

     { "insecure-registries":["registry-hostname:5000"] }

    replacing registry-hostname with the FQDN of your registry server.

  2. Restart the docker daemon.

     $ sudo service docker restart

Top